package com.example.demo.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.Dictionary;
import com.example.demo.entity.Menu;
import com.example.demo.entity.dto.PageDto;
import com.example.demo.entity.vo.PageVo;
import com.example.demo.service.DictionaryService;
import com.example.demo.mapper.DictionaryMapper;
import com.example.demo.util.QueryWraperUtil;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author admin
* @description 针对表【dictionary】的数据库操作Service实现
* @createDate 2024-01-19 10:40:53
*/
@Service
public class DictionaryServiceImpl extends ServiceImpl<DictionaryMapper, Dictionary> implements DictionaryService{

    @Override
    public List<Dictionary> getList(Dictionary dictionary) {
        return baseMapper.selectList(QueryWraperUtil.getQueryWrap(dictionary));
    }

    @Override
    public PageVo<Dictionary> getPage(PageDto<Dictionary> pageDto) {
        IPage<Dictionary> iPage=baseMapper.selectPage(new Page<>(pageDto.getCurrent(),pageDto.getSize()),QueryWraperUtil.getQueryWrap(pageDto.getCdt()));
        return new PageVo<>(iPage.getRecords(),iPage.getCurrent(),iPage.getSize(),iPage.getTotal());
    }
}




